package com.woniuxy.mongdbtest.entity;

import com.alibaba.fastjson.JSONArray;

import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.util.StringUtils;

import java.util.List;


@Data
@Document("BookingRule")
public class BookingRule {

	private Integer cycle;

	private String releaseTime;

	private String stopTime;

	private Integer quitDay;

	private String quitTime;

	private List<String> rule;

	/**
	    * TODO:返回规则
	**/
	public void setRule(String rule) {
		if(!StringUtils.isEmpty(rule)) {
			this.rule = JSONArray.parseArray(rule, String.class);
		}
	}

}

